<?php


namespace App\Http\Controllers\Api;


use App\Models\Recommend;
use Dingo\Api\Http\Request;

class RecommendController extends BaseController
{

    public function store(Request $request) {
        $this->validate($request, [
            'company_id' => 'required|exists:company,id',
            'position_id' => 'required|exists:position,id',
            'phone' => 'regex:/^1[3456789][0-9]{9}$/',
            'real_name' => 'required',
        ]);
        $input = $request->input();
        $info = Recommend::create($input);
        $id = $info->id;
        return $this->success($id);
    }


}

